package com.example.assisteddriving.util;

import android.util.Log;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import java.util.ArrayList;
import java.util.List;

public class MyFragementpageAdapter extends FragmentStateAdapter {
    List<Fragment> fragmentsList=new ArrayList<>();
    public MyFragementpageAdapter(@NonNull FragmentManager fragmentManager, @NonNull Lifecycle lifecycle, List<Fragment>fragments) {
        super(fragmentManager, lifecycle);
        fragmentsList=fragments;
        Log.e("asd", String.valueOf(fragmentsList.size()));
    }

    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return fragmentsList.get(position);
    }

    @Override
    public int getItemCount() {
        return fragmentsList.size();
    }

}
